package com.dek.ssm.ch2.reflect;

public class ReflectServiceImpl2 {
	
	private String name;

	public ReflectServiceImpl2(String name) {
		super();
		this.name = name;
	}
	
	public void sayhello() {
		System.err.println("hello " + name);
	}
	
	public static ReflectServiceImpl2 getInstance() {
		ReflectServiceImpl2 object = null;
		try {
			object = (ReflectServiceImpl2) Class.forName("com.dek.ssm.ch2.reflect.ReflectServiceImpl2")
					.getConstructor(String.class).newInstance("dek");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return object;
	}
	
	public static void main(String[] args) {
		ReflectServiceImpl2.getInstance().sayhello();
	}
	
	
}
